package com.zhu.androidsample.util;

import android.net.Uri;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.drawee.interfaces.DraweeController;
import com.facebook.imagepipeline.request.ImageRequest;
import com.facebook.imagepipeline.request.ImageRequestBuilder;

/**
 * Created by ZCP on 2015/11/22.
 * mail:43426073@qq.com
 */
public class FrescoUtil {

    public static DraweeController getGifDraweeController(Uri uri) {

        ImageRequest request = ImageRequestBuilder.newBuilderWithSource(uri).build();
        return Fresco.newDraweeControllerBuilder()
                .setImageRequest(request)
                .setAutoPlayAnimations(true)
                .build();

    }
}
